package com.lindom.mapper;
import com.lindom.pojo.User;
import org.mybatis.spring.support.SqlSessionDaoSupport;
import java.util.List;

public class UserMapperImpl extends SqlSessionDaoSupport implements UserMapper {

    public List<User> selectUser() {

        User liang = new User(7, "梁非凡", "9999999");
        add(liang);
        delete(7);

        return getSqlSession().getMapper(UserMapper.class).selectUser();
    }

    public int add(User user) {
        return getSqlSession().getMapper(UserMapper.class).add(user);
    }

    public int delete(int id) {
        return getSqlSession().getMapper(UserMapper.class).delete(id);
    }
}
